﻿using StarPizza.Model.Ordering;
using StarPizza.ViewModel.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StarPizza.ViewModel.ClientSystem
{
    class OrderController
    {
        Cart cart;
        OrderProcessor orderProcessor;

        public OrderController(OrderProcessor orderProcessor)
        {
            this.orderProcessor = orderProcessor;
        }
        public void setCart(Cart cart)
        {
            this.cart = cart;
        }
        public void AddPizza(PizzaVM pizza)
        {
            orderProcessor.AddPizza(pizza);
            if (cart != null)
                cart.AddPizza(pizza);
        }
        public void CancelPizza(PizzaVM pizza)
        {
            orderProcessor.CancelPizza(pizza);
        }
        public void FinalizaOrder(IEnumerable<PizzaVM> pizzas)
        {
            orderProcessor.FinalizeOrder(pizzas);
        }
    }
}
